
*	************************************************************************
* 	File-Name: 		EE_2013_Brazil_replication.do
*	Date:  			13 May 2013
*	Authors: 		Michael Aklin, Patrick Bayer, S.P. Harish and Johannes Urpelainen
*	Journal:		Ecological Economics
* 	Paper:			Understanding Environmental Preferences: New Evidence from Brazil
*
*	Data Used:  	Brazil.dta	
*	Purpose:   		.do file for replication
*	Software:		Stata IC 12.1
*	Machine:		WINDOWS 7
*
*	************************************************************************

clear all

* NB: Please place .do file and data in the same folder
use "./Brazil.dta"
set more off, permanently


*	************************************************************************
*	(I) MAIN TEXT
*	************************************************************************

*	************************************************************************
*	1. Summary statistics
*	************************************************************************

* Label variables properly
label variable q5_recode "Env in Intl Negotiations"
label variable q6_recode "Env in Candidate's Proposals"
label variable q8_recode "Sufficiency of Environmental Legislation"
label variable q12_recode "Allow Increase in Pollution Levels"
label variable factor1 "Factor Analysis Q1-Q4"

estpost summ q6_recode q8_recode q12_recode q5_recode factor1 income educ age female capital metro


*	************************************************************************
*	2. Main results table
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state, robust
eststo: xi: reg q6_recode income educ age female capital metro i.state, robust
eststo: xi: reg q8_recode income educ i.state, robust
eststo: xi: reg q8_recode income educ age female capital metro i.state, robust
eststo: xi: logit q12_recode income educ i.state, robust
eststo: xi: logit q12_recode income educ age female capital metro i.state, robust
eststo: xi: reg q5_recode income educ i.state, robust
eststo: xi: reg q5_recode income educ age female capital metro i.state, robust
eststo: xi: reg factor1 income educ i.state, robust
eststo: xi: reg factor1 income educ age female capital metro i.state, robust


*	************************************************************************
*	3. Main results for expanded analysis
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode i.income i.educ i.state, robust
eststo: xi: reg q6_recode i.income i.educ age female capital metro i.state, robust
eststo: xi: reg q8_recode i.income i.educ i.state, robust
eststo: xi: reg q8_recode i.income i.educ age female capital metro i.state, robust
eststo: xi: logit q12_recode i.income i.educ i.state, robust
eststo: xi: logit q12_recode i.income i.educ age female capital metro i.state, robust
eststo: xi: reg q5_recode i.income i.educ i.state, robust
eststo: xi: reg q5_recode i.income i.educ age female capital metro i.state, robust
eststo: xi: reg factor1 i.income i.educ i.state, robust
eststo: xi: reg factor1 i.income i.educ age female capital metro i.state, robust


*	************************************************************************
*	(II) APPENDIX
*	************************************************************************

*	************************************************************************
*	A2 -- Additional Information (Table A1)
*	************************************************************************

* Create variable labels
label variable q6_recode "Q1"
label variable q8_recode "Q2"
label variable q12_recode "Q3"
label variable q5_recode "Q4"

estpost corr q6_recode q8_recode q12_recode q5_recode educ age income female, matrix

*	************************************************************************
*	A3 -- Robustness: Models with Region Fixed Effects (Table A3)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.region, robust
eststo: xi: reg q6_recode income educ age female capital metro i.region, robust
eststo: xi: reg q8_recode income educ i.region, robust
eststo: xi: reg q8_recode income educ age female capital metro i.region, robust
eststo: xi: logit q12_recode income educ i.region, robust
eststo: xi: logit q12_recode income educ age female capital metro i.region, robust
eststo: xi: reg q5_recode income educ i.region, robust
eststo: xi: reg q5_recode income educ age female capital metro i.region, robust


*	************************************************************************
*	A4 -- Robustness: Models with Interaction Effect (Table A4)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode incomedummy educ incd_x_educ i.state, robust
eststo: xi: reg q6_recode incomedummy educ incd_x_educ age female capital metro i.state, robust
eststo: xi: reg q8_recode incomedummy educ incd_x_educ i.state, robust
eststo: xi: reg q8_recode incomedummy educ incd_x_educ age female capital metro i.state, robust
eststo: xi: logit q12_recode incomedummy educ incd_x_educ i.state, robust
eststo: xi: logit q12_recode incomedummy educ incd_x_educ age female capital metro i.state, robust
eststo: xi: reg q5_recode incomedummy educ incd_x_educ i.state, robust
eststo: xi: reg q5_recode incomedummy educ incd_x_educ age female capital metro i.state, robust

*	************************************************************************
*	A5 -- Robustness: Ordered Probit Models (Tables A5-A6)
*	************************************************************************

eststo clear
eststo: xi: oprobit q6_recode income educ i.state, robust
eststo: xi: oprobit q6_recode income educ age female capital metro i.state, robust
eststo: xi: oprobit q8_recode income educ i.state, robust
eststo: xi: oprobit q8_recode income educ age female capital metro i.state, robust
eststo: xi: oprobit q5_recode income educ i.state, robust
eststo: xi: oprobit q5_recode income educ age female capital metro i.state, robust

eststo clear
eststo: xi: oprobit q6_recode i.income i.educ i.state, robust
eststo: xi: oprobit q6_recode i.income i.educ age female capital metro i.state, robust
eststo: xi: oprobit q8_recode i.income i.educ i.state, robust
eststo: xi: oprobit q8_recode i.income i.educ age female capital metro i.state, robust
eststo: xi: oprobit q5_recode i.income i.educ i.state, robust
eststo: xi: oprobit q5_recode i.income i.educ age female capital metro i.state, robust


*	************************************************************************
*	A6 -- Models Without Fixed Effects (Tables A7-A8)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ, robust
eststo: xi: reg q6_recode income educ age female capital metro, robust
eststo: xi: reg q8_recode income educ, robust
eststo: xi: reg q8_recode income educ age female capital metro, robust
eststo: xi: logit q12_recode income educ, robust
eststo: xi: logit q12_recode income educ age female capital metro, robust
eststo: xi: reg q5_recode income educ, robust
eststo: xi: reg q5_recode income educ age female capital metro, robust

eststo clear
eststo: xi: reg q6_recode i.income i.educ, robust
eststo: xi: reg q6_recode i.income i.educ age female capital metro, robust
eststo: xi: reg q8_recode i.income i.educ, robust
eststo: xi: reg q8_recode i.income i.educ age female capital metro, robust
eststo: xi: logit q12_recode i.income i.educ, robust
eststo: xi: logit q12_recode i.income i.educ age female capital metro, robust
eststo: xi: reg q5_recode i.income i.educ, robust
eststo: xi: reg q5_recode i.income i.educ age female capital metro, robust


*	************************************************************************
*	A7 -- Robustness: Models with Sample Weights (Tables A11-A12)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state [pweight=sweight], robust
eststo: xi: reg q6_recode income educ age female capital metro i.state [pweight =sweight], robust
eststo: xi: reg q8_recode income educ i.state [pweight =sweight], robust
eststo: xi: reg q8_recode income educ age female capital metro i.state [pweight =sweight], robust
eststo: xi: logit q12_recode income educ i.state [pweight =sweight], robust
eststo: xi: logit q12_recode income educ age female capital metro i.state [pweight =sweight], robust
eststo: xi: reg q5_recode income educ i.state [pweight =sweight], robust
eststo: xi: reg q5_recode income educ age female capital metro i.state [pweight =sweight], robust

eststo clear
eststo: xi: reg q6_recode i.income i.educ i.state [pweight =sweight], robust
eststo: xi: reg q6_recode i.income i.educ age female capital metro i.state [pweight =sweight], robust
eststo: xi: reg q8_recode i.income i.educ i.state [pweight =sweight], robust
eststo: xi: reg q8_recode i.income i.educ age female capital metro i.state [pweight =sweight], robust
eststo: xi: logit q12_recode i.income i.educ i.state [pweight =sweight], robust
eststo: xi: logit q12_recode i.income i.educ age female capital metro i.state [pweight =sweight], robust
eststo: xi: reg q5_recode i.income i.educ i.state [pweight =sweight], robust
eststo: xi: reg q5_recode i.income i.educ age female capital metro i.state [pweight =sweight], robust


*	************************************************************************
*	A8 -- Robustness: Models with Factor Analysis (Table A13)
*	************************************************************************

eststo clear
eststo: xi: reg factor1 income educ i.state, robust
eststo: xi: reg factor1 income educ age female capital metro i.state, robust
eststo: xi: reg factor1 i.income i.educ i.state, robust
eststo: xi: reg factor1 i.income i.educ age female capital metro i.state, robust


*	************************************************************************
*	A9 -- Robustness: Models with Income and without Education (Tables A14-15)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income i.state, robust
eststo: xi: reg q6_recode income age female capital metro i.state, robust
eststo: xi: reg q8_recode income i.state, robust
eststo: xi: reg q8_recode income age female capital metro i.state, robust
eststo: xi: logit q12_recode income i.state, robust
eststo: xi: logit q12_recode income age female capital metro i.state, robust
eststo: xi: reg q5_recode income i.state, robust
eststo: xi: reg q5_recode income age female capital metro i.state, robust
eststo: xi: reg factor1 income i.state, robust
eststo: xi: reg factor1 income age female capital metro i.state, robust

eststo clear
eststo: xi: reg q6_recode i.income i.state, robust
eststo: xi: reg q6_recode i.income age female capital metro i.state, robust
eststo: xi: reg q8_recode i.income i.state, robust
eststo: xi: reg q8_recode i.income age female capital metro i.state, robust
eststo: xi: logit q12_recode i.income i.state, robust
eststo: xi: logit q12_recode i.income age female capital metro i.state, robust
eststo: xi: reg q5_recode i.income i.state, robust
eststo: xi: reg q5_recode i.income age female capital metro i.state, robust
eststo: xi: reg factor1 i.income i.state, robust
eststo: xi: reg factor1 i.income age female capital metro i.state, robust


*	************************************************************************
*	A10 -- Robustness: Models with Education and without Income (Tables A16-A17)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode educ i.state, robust
eststo: xi: reg q6_recode educ age female capital metro i.state, robust
eststo: xi: reg q8_recode educ i.state, robust
eststo: xi: reg q8_recode educ age female capital metro i.state, robust
eststo: xi: logit q12_recode educ i.state, robust
eststo: xi: logit q12_recode educ age female capital metro i.state, robust
eststo: xi: reg q5_recode educ i.state, robust
eststo: xi: reg q5_recode educ age female capital metro i.state, robust
eststo: xi: reg factor1 educ i.state, robust
eststo: xi: reg factor1 educ age female capital metro i.state, robust


eststo clear
eststo: xi: reg q6_recode i.educ i.state, robust
eststo: xi: reg q6_recode i.educ age female capital metro i.state, robust
eststo: xi: reg q8_recode i.educ i.state, robust
eststo: xi: reg q8_recode i.educ age female capital metro i.state, robust
eststo: xi: logit q12_recode i.educ i.state, robust
eststo: xi: logit q12_recode i.educ age female capital metro i.state, robust
eststo: xi: reg q5_recode i.educ i.state, robust
eststo: xi: reg q5_recode i.educ age female capital metro i.state, robust
eststo: xi: reg factor1 i.educ i.state, robust
eststo: xi: reg factor1 i.educ age female capital metro i.state, robust


*	************************************************************************
*	A11 -- Robustness: Respondents about 20 Years Old (Tables A18-A19)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state if age >= 2, robust
eststo: xi: reg q6_recode income educ age female capital metro i.state if age >= 2, robust
eststo: xi: reg q8_recode income educ i.state if age >= 2, robust
eststo: xi: reg q8_recode income educ age female capital metro i.state if age >= 2, robust
eststo: xi: logit q12_recode income educ i.state if age >= 2, robust
eststo: xi: logit q12_recode income educ age female capital metro i.state if age >= 2, robust
eststo: xi: reg q5_recode income educ i.state if age >= 2, robust
eststo: xi: reg q5_recode income educ age female capital metro i.state if age >= 2, robust
eststo: xi: reg factor1 income educ i.state if age >= 2, robust
eststo: xi: reg factor1 income educ age female capital metro i.state if age >= 2, robust

eststo clear
eststo: xi: reg q6_recode i.income i.educ i.state if age >= 2, robust
eststo: xi: reg q6_recode i.income i.educ age female capital metro i.state if age >= 2, robust
eststo: xi: reg q8_recode i.income i.educ i.state if age >= 2, robust
eststo: xi: reg q8_recode i.income i.educ age female capital metro i.state if age >= 2, robust
eststo: xi: logit q12_recode i.income i.educ i.state if age >= 2, robust
eststo: xi: logit q12_recode i.income i.educ age female capital metro i.state if age >= 2, robust
eststo: xi: reg q5_recode i.income i.educ i.state if age >= 2, robust
eststo: xi: reg q5_recode i.income i.educ age female capital metro i.state if age >= 2, robust
eststo: xi: reg factor1 i.income i.educ i.state if age >= 2, robust
eststo: xi: reg factor1 i.income i.educ age female capital metro i.state if age >= 2, robust


*	************************************************************************
*	A12 -- Robustness: Models without Highest Earners (Table A20)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state if income < 5, robust
eststo: xi: reg q6_recode income educ age female capital metro i.state if income < 5, robust
eststo: xi: reg q8_recode income educ i.state if income < 5, robust
eststo: xi: reg q8_recode income educ age female capital metro i.state if income < 5, robust
eststo: xi: logit q12_recode income educ i.state if income < 5, robust
eststo: xi: logit q12_recode income educ age female capital metro i.state if income < 5, robust
eststo: xi: reg q5_recode income educ i.state if income < 5, robust
eststo: xi: reg q5_recode income educ age female capital metro i.state if income < 5, robust
eststo: xi: reg factor1 income educ i.state if income < 5, robust
eststo: xi: reg factor1 income educ age female capital metro i.state if income < 5, robust


*	************************************************************************
*	A13 -- Robustness: Models wihtout Lowest Earners (Table A21)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state if income > 1, robust
eststo: xi: reg q6_recode income educ age female capital metro i.state if income > 1, robust
eststo: xi: reg q8_recode income educ i.state if income > 1, robust
eststo: xi: reg q8_recode income educ age female capital metro i.state if income > 1, robust
eststo: xi: logit q12_recode income educ i.state if income > 1, robust
eststo: xi: logit q12_recode income educ age female capital metro i.state if income > 1, robust
eststo: xi: reg q5_recode income educ i.state if income > 1, robust
eststo: xi: reg q5_recode income educ age female capital metro i.state if income > 1, robust
eststo: xi: reg factor1 income educ i.state if income > 1, robust
eststo: xi: reg factor1 income educ age female capital metro i.state if income > 1, robust

*	************************************************************************
*	A14 -- Models without Most Educated (Table A22)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state if educ < 3, robust
eststo: xi: reg q6_recode income educ age female capital metro i.state if educ < 3, robust
eststo: xi: reg q8_recode income educ i.state if educ < 3, robust
eststo: xi: reg q8_recode income educ age female capital metro i.state if educ < 3, robust
eststo: xi: logit q12_recode income educ i.state if educ < 3, robust
eststo: xi: logit q12_recode income educ age female capital metro i.state if educ < 3, robust
eststo: xi: reg q5_recode income educ i.state if educ < 3, robust
eststo: xi: reg q5_recode income educ age female capital metro i.state if educ < 3, robust
eststo: xi: reg factor1 income educ i.state if educ < 3, robust
eststo: xi: reg factor1 income educ age female capital metro i.state if educ < 3, robust


*	************************************************************************
*	A15 -- Robustness: Models without Least Educated (Table A23)
*	************************************************************************

eststo clear
eststo: xi: reg q6_recode income educ i.state if educ > 1, robust
eststo: xi: reg q6_recode income educ age female capital metro i.state if educ > 1, robust
eststo: xi: reg q8_recode income educ i.state if educ > 1, robust
eststo: xi: reg q8_recode income educ age female capital metro i.state if educ > 1, robust
eststo: xi: logit q12_recode income educ i.state if educ > 1, robust
eststo: xi: logit q12_recode income educ age female capital metro i.state if educ > 1, robust
eststo: xi: reg q5_recode income educ i.state if educ > 1, robust
eststo: xi: reg q5_recode income educ age female capital metro i.state if educ > 1, robust
eststo: xi: reg factor1 income educ i.state if educ > 1, robust
eststo: xi: reg factor1 income educ age female capital metro i.state if educ > 1, robust




